// TOWN SCRIPT
//    Town 2: Kingdom Hospital
// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

begintownscript;

variables;

int i,j,k;

body;

beginstate INIT_STATE;
// This state called whenever this town is entered.
force_view_center(36,44);
force_instant_terrain_redraw();


	j = 39;
		while(j >= 0) {
			destroy_char_item(0,j);
			j = j - 1;
		}

//prep party (copied/pasted from EP to save time)
force_instant_terrain_redraw();
force_view_center(35,44);
force_instant_terrain_redraw();
set_character_pose(1000,14);
force_instant_terrain_redraw();

pause(5);

force_instant_terrain_redraw();
message_dialog("You wake up slowly, still groggy from the meds you were given during the night. You get to your feet slowly, and rub the sleep from your eyes.","Things are quiet for now, and you look forward to getting dressed and going to the garden...");

set_character_pose(1000,0);
relocate_character(0,36,44);
force_instant_terrain_redraw();

break;

beginstate EXIT_STATE;
// Always called when the town is left.
break;

beginstate START_STATE;
// This state is called every turn the party is in this town.
break;

beginstate 10;
	if(get_flag(2,0) == 0) {
		message_dialog("The hospital's dining room is fairly empty. You must have missed breakfast already.","You look around, and somebody catches your gaze, before turning away and staring at somebody else. You don't like these people, and you don't want to talk to them. You just want to be on your own in the garden.");
		set_flag(0,2,1);
	}
break;

beginstate 11;
	reset_dialog();
	add_dialog_str(0,"You approach the tree, your favourite spot in the hospital. You really want to settle down beneath it, and just be on your own. That's all you've ever wanted. Sit?",0);
	add_dialog_choice(0,"Yes.");
	add_dialog_choice(1,"No.");
	if(run_dialog(1) == 1) {
		message_dialog("You sit down, and wait for night to come.","");
		end_scenario(1);
	} else {
		block_entry(1);
	}
	
break;

beginstate 12;
	if(get_flag(2,1) == 0) {
		message_dialog("This is the other ward, on this level. This is where the _lower-risk_ patients sleep. Right now, though, it's completely empty.","At first you think everybody must be in the reading room, or something, until you recall that the _safer_ patients are being taken out on a day-trip. Whatever.");
		set_flag(2,1,1);
	}
break;

beginstate 13;
	message_dialog("These books are all crap. They're about helping you _deal_ with your _condition_, and other mental disorders in general.","None of them interest you. You'd prefer to be in the garden.");
break;

beginstate 14;
	if(get_flag(2,2) == 0) {
		message_dialog("The hosptial's library is fairly quiet. Probably because all the books are terrible, although maybe it's because the people here have convinced themselves they are ducks and can't read...","");
		set_flag(2,2,1);
	}
break;

beginstate 15;
	if(get_flag(2,3) == 0) {
		message_dialog("The garden is blissfully empty. At least you can be out here in relative peace. You ain't ever alone, but it's enough just to sit on the soft grass watching the sky.","");
		set_flag(2,3,1);
	}
break;

